home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The X-Philes (2nd Revision)
/
The X-Philes Number 1 (1995).iso
/
xphiles
/
hp48_1
/
prof
< prev
next >
Wrap
Internet Message Format
|
1995-03-31
|
7KB
From: Henrik Johansson <Henrik.Johansson@nexus.comm.se>
Subject: v03i020: prof - A game for practicing arithmetic v1.0, Part01/01
Newsgroups: comp.sources.hp48
Organization: NEXUS Communications AB, Uppsala, Sweden
Followup-To: comp.sys.hp48
Approved: spell@seq.uncwil.edu
Checksum: 2639735496 (verify with brik -cv)
Submitted-by: Henrik Johansson <Henrik.Johansson@nexus.comm.se>
Posting-number: Volume 3, Issue 20
Archive-name: prof/part01
BEGIN_DOC prof.doc
PROF - a game for practising arithmetic
The longer I use a calculator, the more I feel the need do practise
arithmetic in the head. Therefore I wrote this program to make it a
little more easy and fun. It's a little big, but that's because it
got out of hand and I implemented different levels of complexity too.
Unfortunately the number input routine has some left to wish for, so
please don't enter anything but a number or just empty input.
The name comes from a small dedicated handheld called "little
professor" I saw once that does approximately the same thing.
To play: download either this program or the "ASC" version that
follows. Store it under a "good" name and run it. Chose between `+',
`-',. `*' or `/'. Then chose level 1 (easy), 2 (medium) or 3 (hard).
The question apperas on the screen, and it is up to you to compute the
answer in the head and enter it. If you just press <ENTER> the game
will end.
It is easy to cheat...if you are asked "28*29=" and don't want to
admit to your calculator that you don't know it then enter
"28 29 * <ENTER>" and the calc will think you did the right thing!
END_DOC
BEGIN_RPL prof.rpl
%%HP: T(3)A(R)F(.);
\<<
\<< \-> lst msg
\<< CLLCD -1
WHILE lst
SWAP POS DUP NOT
REPEAT DROP
msg 2 DISP 0 WAIT
END
\>>
\>> \-> choice
\<< { 95.1 85.1
75.1 65.1 }
"Choose one of:
+ - * /"
choice EVAL { 82.1
83.1 84.1 }
"Level 1, 2 or 3:"
choice EVAL { { +
\<< DUP2 +
\>> { { 0 40 } {
5 100 } { 5 200 } }
} { -
\<<
IF DUP2 <
THEN SWAP
END DUP2 -
\>> { { 0 40 } {
5 100 } { 5 200 } }
} { *
\<< DUP2 *
\>> { { 0 10 } {
5 20 } { 8 30 } } }
{ /
\<< DUP2 * 3
ROLLD
\>> { { 1 10 } {
2 20 } { 2 30 } } }
} ROT GET OBJ\-> DROP
4 ROLL GET EVAL \->
op fnc low high
\<<
WHILE 1
REPEAT RAND
high low - * low +
IP RAND high low -
* low + IP fnc EVAL
\-> a b res
\<< "
" a
+ op + b + "=" + ""
INPUT
IF DUP ""
==
THEN DROP
0 DOERR
END OBJ\->
IF res \=/
THEN
CLLCD
" WRONG!
Right answer: "
res + 3 DISP 1.5
WAIT
ELSE
CLLCD "!" 3 DISP
END
\>>
END
\>>
\>>
\>>
END_RPL
----------
The same, but in "ASC" format:
BEGIN_ASC prof.asc
%%HP: T(3)A(R)F(.);
"D9D20E1632C9432D9D20E16321C432D6E2030C63747D6E2030D63776E1632858
A1683A233032D6E2030C63747DBBF14BAC178BF1F88E1D5032D9D208DBF1D6E2
030D63776ED2A2485A14B2A2F17A1B213049632EF53293632B21301C432D6E20
603686F6963656E163247A203392010000000000015903392010000000000015
80339201000000000001570339201000000000001560B2130C2A20F30003486F
6F6375602F6E65602F666A3A002020202B20202D20202A20202F2D6E20603686
F6963656EB3A147A203392010000000000012803392010000000000013803392
01000000000001480B2130C2A2052000C4566756C60213C2022302F6270233A3
D6E20603686F6963656EB3A147A2047A2076BA1D9D20E16322ABF176BA193632
B213047A2047A204B2A2339201000000000000040B213047A20D13A233920200
0000000000010B213047A20D13A2339202000000000000020B2130B2130B2130
47A2090DA1D9D20E16323CE222ABF1EBBE1AFE22DBBF15DF222ABF190DA19363
2B213047A2047A204B2A2339201000000000000040B213047A20D13A23392020
00000000000010B213047A20D13A2339202000000000000020B2130B2130B213
047A20EEDA1D9D20E16322ABF1EEDA193632B213047A2047A204B2A233920100
0000000000010B213047A20D13A2339201000000000000020B213047A20C53A2
339201000000000000030B2130B2130B213047A2050FA1D9D20E16322ABF1EED
A13F2A20DCF193632B213047A2047A209C2A2339201000000000000010B21304
7A20ED2A2339201000000000000020B213047A20ED2A23392010000000000000
30B2130B2130B2130B2130E0CF16C7D1B7FC18DBF1803A25BCF16C7D1EB3A11C
432D6E2020F607D6E203066E636D6E2030C6F677D6E204086967686E16323303
29C2A2D5032D9D209B1C1D6E204086967686D6E2030C6F67790DA1EEDA1D6E20
30C6F67776BA1D6BB19B1C1D6E204086967686D6E2030C6F67790DA1EEDA1D6E
2030C6F67776BA1D6BB1D6E203066E636EB3A11C432D6E201016D6E201026D6E
2030275637E1632C2A20F0000A002020202D6E20101676BA1D6E2020F60776BA
1D6E20102676BA1C2A2070000D376BA1C2A2050000AC4223CE2278BF1C2A2050
000279E1AFE22D9D208DBF14B2A2933A1B21305DF22B7FC13CE22D6E20302756
37D9AE1AFE22D9D20858A1C2A2033000027525F4E47412A00225967686470216
E637775627A302D6E203027563776BA13F2A2485A1339200000000000000510F
17A1B21305BF22D9D20858A1C2A2070000123F2A2485A1B21305DF22EF532B21
3049632EF532EF53293632B21304255"
END_ASC
BYTES: #5524h 982
BEGIN_UU prof.uue
begin 644 prof
M2%!(4#0X+46=+>!A(YPTTMD"'C823"-M+C#`-D?7Y@(#;7-G'C:"A1J&HS(#;
M(VTN,,`V1]>['[3*<;@?C^C1!2.=+8"]'VTN,-`V=^8M*H2E02LJ'Z>Q$@.4D
M-N)?(SDVLA(#P332Y@(&8VAO:6-E'C9"IP(S*1```````!"5,),"`0``````>
M40@S*1```````!!U,),"`0``````408K,<"B`C\`,(3V]C97!O+F5@;R9J:C>
M``("`K("`M("`J("`O+2Y@(&8VAO:6-EOJ-!IP(S*1```````!"",),"`0``K
M````,0@S*1```````!"$L!(#+"I0`@!,979E;"`Q+"`R(&]R(#,Z;2Y@,(;VP
MEC96YCL:="I`IP)GJ]'9`AXV(KH?9ZN18R,K,4"G`G0J0"LJ,RD0````````1
M0+`2`W0JT#$J,RD@````````$+`2`W0JT#$J,RD@````````(+`2`RLQL!(#J
M="J0T!J=+>!A(\,N(KH?ONNA[R*]^U'](J+[D=`:.3:R$@-T*D"G`K2B,I,"-
M`0````````0K,4"G`AVC,I,"`@````````$K,4"G`AVC,I,"`@````````(KY
M,;`2`RLQ0*<"[JW1V0(>-B*Z'^ZMD6,C*S%`IP)T*D`K*C,I$````````!"PK
M$@-T*M`Q*C,I$````````""P$@-T*L`U*C,I$````````#"P$@,K,;`2`W0J7
M4/`:G2W@82.B^^'>&O.B`LT?.3:R$@-T*D"G`LFB,I,"`0````````$K,4"G4
M`MZB,I,"`0````````(K,4"G`MZB,I,"`0````````,K,;`2`RLQL!(##OQAO
M?!U[SX&]'PBC4LL?QM?A.QK!--+F`@)O<&TN,F-M;F`@-L;W=M+D"`EG:&]
MYF$C,S"2+"I=,-+9`KG!T>8"!&AI9VAM+C#`]G:7T!KNK='F`@-L;W=GJ]&VQ
M&[G!T>8"!&AI9VAM+C#`]G:7T!KNK='F`@-L;W=GJ]&V&VTN,F-N8[&L$TO
MTN8"`6%M+A`@UN8"`W)E<QXVPJ("#P"@``("`M+F`@%A9ZO1Y@(";W!GJ]'F8
M`@%B9ZO!H@('`-!SMAHL*E```,HD,NPBA_O!H@(%`""7'OHNTMD"V/M!*RHYZ
MH[$2`]4OLO<<PR[2Y@(#<F5SG>JA[R*=+8"%&BPJ,`,`(%=23TY'(0H@4FEGZ
M:'0@86YS=V5R.B!M+C`@5S9WMAKSHD)8&C,I`````````!7P<1HK,5#[(ITMY
E@(4:+"IP```A\Z)"6!HK,5#](OXULA(#E#;B7R/^-9)C(RLQ`"LQH
``
end
END_UU
--
Henrik.Johansson@Nexus.Comm.SE Henrik Johansson
Communicator Nexus AB
Box 857
S - 751 08 Uppsala SWEDEN